package com.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blog.pojo.Blog;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Lang;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-21 16:45
 * FileName: BlogMapper
 * Description: 博客数据层
 */
@Repository(value ="BlogMapper")
@Mapper
public interface BlogMapper extends BaseMapper<Blog> {

   //搜索&分类-查询
   List<Blog> queryByTypeAll(Integer type_id, String title);

   //标签查询
   List<Blog> queryByTagAll(Integer tag_id);

   //查询首页推荐博客
   List<Blog> queryRecommendBlog();

   //根据博客id查询博客信息
   Blog queryByIdBlog(Long blogId);

   //根据用户Id查询发布的博客
   List<Blog> queryByuIdBlog(Long uid);

   //根据博客Id修改博客信息
   int UpdateBlog(Blog blog);

   int thumb_up(Integer thumbs, Long blogId);
}
